%%{init: {'themeVariables': { 'fontSize': '12px'}}}%%
graph TD
    classDef path fill:#eee,stroke:#000,color:#000
    classDef plan fill:#fff,stroke-width:1px,color:#000
    classDef itemplan fill:#fff,stroke-width:2px,color:#000
    classDef unbatchedplan fill:#dff,stroke-width:1px,color:#000
    classDef sideeffectplan fill:#fcc,stroke-width:2px,color:#000
    classDef bucket fill:#f6f6f6,color:#000,stroke-width:2px,text-align:left

    subgraph "Buckets for queries/v4/json-nested-query"
    Bucket0("Bucket 0 (root)<br /><br />1: <br />ᐳ: 7, 10, 11, 6, 12, 13<br />2: PgSelect[9]<br />3: PgSelectRows[15]<br />ᐳ: 14, 16, 17"):::bucket
    end

    %% plan dependencies
    PgSelect9[["PgSelect[9∈0] ➊<br />ᐸjson_identityᐳ"]]:::plan
    Object12{{"Object[12∈0] ➊<br />ᐸ{pgSettings,withPgClient}ᐳ"}}:::plan
    PgFromExpression13{{"PgFromExpression[13∈0] ➊"}}:::plan
    Object12 & PgFromExpression13 --> PgSelect9
    Access10{{"Access[10∈0] ➊<br />ᐸ2.pgSettingsᐳ"}}:::plan
    Access11{{"Access[11∈0] ➊<br />ᐸ2.withPgClientᐳ"}}:::plan
    Access10 & Access11 --> Object12
    __InputDynamicScalar6{{"__InputDynamicScalar[6∈0] ➊"}}:::plan
    Access7{{"Access[7∈0] ➊<br />ᐸ0.valueᐳ"}}:::plan
    Access7 --> __InputDynamicScalar6
    __Value0["__Value[0∈0] ➊<br />ᐸvariableValuesᐳ"]:::plan
    __Value0 --> Access7
    __Value2["__Value[2∈0] ➊<br />ᐸcontextᐳ"]:::plan
    __Value2 --> Access10
    __Value2 --> Access11
    __InputDynamicScalar6 --> PgFromExpression13
    First14{{"First[14∈0] ➊"}}:::plan
    PgSelectRows15[["PgSelectRows[15∈0] ➊"]]:::plan
    PgSelectRows15 --> First14
    PgSelect9 --> PgSelectRows15
    PgSelectSingle16{{"PgSelectSingle[16∈0] ➊<br />ᐸjson_identityᐳ"}}:::plan
    First14 --> PgSelectSingle16

    %% define steps
    classDef bucket0 stroke:#696969
    class Bucket0,__Value0,__Value2,__InputDynamicScalar6,Access7,PgSelect9,Access10,Access11,Object12,PgFromExpression13,First14,PgSelectRows15,PgSelectSingle16 bucket0

